package com.tiny_wind.resource_manager.utility;

import org.springframework.lang.NonNull;
import org.springframework.lang.Nullable;

public class JsComparisionManager {

    static public boolean isStringEq(@Nullable String target, @NonNull String  pattern) {
        if(target == null) {
            return false;
        }
        else {
            return target.contentEquals(pattern);
        }
    }

    static public <T extends Object> boolean isEq(@Nullable T target,@NonNull T pattern) {
        if(target == null) {
            return false;
        }
        else {
            return target.equals(pattern);
        }
    }

    static public boolean isIntegerEq(@Nullable Integer target,@NonNull Integer pattern) {
        if(target == null) {
            return false;
        }
        else {
            return target.intValue() == pattern.intValue();
        }
    }
}
